<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible content=' IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <link rel="stylesheet" href="./swiper.min.css">
    <script src="./swiper.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html,
        body,
        .swiper-container {
            width: 100%;
            height: 100%;
        }

        .swiper-container {
            height: 50%;
        }

        .swiper-slide {
            background-color: skyblue;
            font-size: 60px;
            font-weight: 600;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    </style>
</head>

<body>
    <!-- 
    注意点：
        1.内容不要乱写乱改，尽量复制
        2.想要轮播图工作，一定要现有结构，再去生成实例，因为实例中要用到真是的dom节点
        3.里面的配置项去查找swiper或者百度
        4.结构和实例一定要一一对应
            多个实例对应一个结构，会出问题，当轮播图走完一圈之后，第二圈会很快闪过
            多个结构对应一个实例，不会出问题，但是这两个轮播图就是一样的效果，没有new实例都是一样的效果
        
  -->
    <div class="swiper-container" id="hh">
        <div class="swiper-wrapper">
            <div class="swiper-slide">Slide 1</div>
            <div class="swiper-slide">Slide 2</div>
            <div class="swiper-slide">Slide 3</div>
            <div class="swiper-slide">Slide 4</div>
        </div>
        <div class="swiper-pagination"></div>
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
    </div>
    <div class="swiper-container" id="ni">
        <div class="swiper-wrapper">
            <div class="swiper-slide">Slide 1</div>
            <div class="swiper-slide">Slide 2</div>
            <div class="swiper-slide">Slide 3</div>
            <div class="swiper-slide">Slide 4</div>
        </div>
        <div class="swiper-pagination"></div>
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
    </div>
    <script>
        new Swiper('#hh', {
            speed: 1000, //切换时间
            loop: true, //无缝轮播
            spaceBetween: 30,
            autoplay: {
                delay: 2000,
                disableOnInteraction: false,
            },
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
        });
        // new Swiper('#hh', {
        //         speed: 1000, //切换时间
        //         loop: true, //无缝轮播
        //         spaceBetween: 30,
        //         autoplay: {
        //             delay: 2000,
        //             disableOnInteraction: false,
        //         },
        //         pagination: {
        //             el: '.swiper-pagination',
        //             clickable: true,
        //         },
        //         navigation: {
        //             nextEl: '.swiper-button-next',
        //             prevEl: '.swiper-button-prev',
        //         },
        //     });
        new Swiper('#ni', {
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
        });
    </script>

</body>

</html>